/**
 * 此模块用于维护详情数据
 *
 * */
import request from '@/utils/request'

/*
* @desc 详情数据
* @params id商品id
* @return Promise
* */
export const getDetailData = (id) => {
  return request({
    method: 'GET',
    url: `/api/item/${id}`
  })
}

/**
 * @desc 添加到购物车
 * @param id
 * @param num
 * @returns {Promise<AxiosResponse<any>>}
 */
export const addToCart = (id, num) => {
  return request({
    method: 'POST',
    url: `/api/cart/addToCart/${id}/${num}`
  })
}
